import request2, { downloadPost } from '@/utils/request2'
import { download, downloadGet } from '@/utils/request2'
import { unionApiUrl } from '../config'
// let unionApiUrl = 'union-producer-server'

export default {
    getPageParameter(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/getPageParameter', method: 'post', params, data
        })
    },
    // 分页查询
    getPage(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/getPage', method: 'post', params, data
        })
    },
    delete(params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/delete', method: 'post', params
        })
    },
    add(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/add', method: 'post', params, data
        })
    },
    update(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/update', method: 'post', params, data
        })
    },
    findById(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/findById', method: 'get', params, data
        })
    },
    //获取资产验收信息
    findByIdParameter(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/findByIdParameter', method: 'get', params, data
        })
    },
    typesLabel(data, params) {
        return request2({
            url: unionApiUrl + '/typesLabel/queryTypesLabelList', method: 'post', params, data
        })
    },
    //添加资产处置台账处置
    insertSelective(data, params) {
        return request2({
            url: unionApiUrl + '/assetDisposal/insertSelective', method: 'post', params, data
        })
    },
    // 编辑资产验收台账
    updateparameter(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/updateparameter', method: 'post', params, data
        })
    },
    //添加资产调拨
    assetTransfersAdd(data, params) {
        return request2({
            url: unionApiUrl + '/assetTransfers/add', method: 'post', params, data
        })
    },
    // 修改资产调拨
    assetTransfersUpdate(data, params) {
        return request2({
            url: unionApiUrl + '/assetTransfers/update', method: 'post', params, data
        })
    },
    // 分页查询
    assetTransfersList(data, params) {
        return request2({
            url: unionApiUrl + '/assetTransfers/getPage', method: 'post', params, data
        })
    },
    // 获取资产调拨信息
    assetTransfersDetail(data, params) {
        return request2({
            url: unionApiUrl + '/assetTransfers/findById', method: 'get', params, data
        })
    },
    // 删除资产调拨
    assetTransfersDel(params) {
        return request2({
            url: unionApiUrl + '/assetTransfers/delete', method: 'post', params
        })
    },
    // 资产台账导出
    export( data) {
        // return download(unionApiUrl + '/assetAcceptance/exportExamPlanMember', data, params)
        return downloadPost(unionApiUrl + '/assetAcceptance/export', data,{},'资产台账.xls')
    },
    // 资产调拨查询资产台账
    getPageParameterTran(data, params) {
        return request2({
            url: unionApiUrl + '/assetAcceptance/getPageParameterTran', method: 'post', data, params
        })
    },
    // 其他资产导出
    exportExamPlanMember(params, data) {
        // return download(unionApiUrl + '/assetAcceptance/exportExamPlanMember', data, params)
        return downloadGet(unionApiUrl + '/assetAcceptance/exportExamPlanMember', null, params)
    },
    // 汽车导出
    exportExamPlanMemberCar(params, data) {
        // return download(unionApiUrl + '/assetAcceptance/exportExamPlanMemberCar', data, params)
        return downloadGet(unionApiUrl + '/assetAcceptance/exportExamPlanMemberCar', null, params)
    },
    // 房屋建筑导出
    exportExamPlanMemberHouse(params, data) {
        // return download(unionApiUrl + '/assetAcceptance/exportExamPlanMemberHouse', data, params)
        return downloadGet(unionApiUrl + '/assetAcceptance/exportExamPlanMemberHouse', null, params)
    },
    // 低值易耗品导出
    exportExamPlanMemberLow(params, data) {
        // return download(unionApiUrl + '/assetAcceptance/exportExamPlanMemberLow', data, params)
        return downloadGet(unionApiUrl + '/assetAcceptance/exportExamPlanMemberLow', null, params)
    }
}
